import { Body, Post, UploadedFile, UseInterceptors } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import Controller from 'src/admin/decorator/controller.decorator';

import { PublishService } from './publish.service';

var moment = require('moment');


@Controller('publish')
export class PublishController {
    constructor(private publishService : PublishService) {}
    @Post('upload')
	@UseInterceptors(FileInterceptor('file'))
    async upload(@UploadedFile() file) {
        return this.publishService.upload(file)

    }

    @Post()
    publish(@Body() params) {
        return this.publishService.publish(params)
    }
}
